// 键盘事件中的按键code值
class KeyEventCode {
  UP = 'ArrowUp';
  DOWN = 'ArrowDown';
  LEFT = 'ArrowLeft';
  RIGHT = 'ArrowRight';
  Delete = 'Delete';
  C = 'KeyC';
  F = 'KeyF';
  M = 'KeyM';
  R = 'KeyR';
  G = 'KeyG';
  L = 'KeyL';
  Enter = 'Enter';
  W = 'KeyW';
  S = 'KeyS';
  A = 'KeyA';
  D = 'KeyD';
  Q = 'KeyQ';
  E = 'KeyE';

  O = 'KeyO';
  T = 'KeyT';
  Y = 'KeyY';
  U = 'KeyU';
  Z = 'KeyZ';
  BACK = 'Backspace';
  DEL = 'Delete';

  D_0 = 'Digit0';
  D_1 = 'Digit1';
  D_2 = 'Digit2';
  D_3 = 'Digit3';
  D_4 = 'Digit4';
  D_5 = 'Digit5';
  D_6 = 'Digit6';
  D_7 = 'Digit7';
  D_8 = 'Digit8';
  D_9 = 'Digit9';
  // 小键盘数字键
  N_0 = 'Numpad0';
  N_2 = 'Numpad2';
  N_4 = 'Numpad4';
  N_5 = 'Numpad5';
  N_6 = 'Numpad6';
  N_8 = 'Numpad8';
}

const KeyCode = new KeyEventCode();

const SceneConfig = {
  version: 1,
  // localSaveName: 'NanHu Layout',
  localSaveName: 'Simulate drone',
  adherePointSpan: 0.5,
  adherePointSpanSq: 0.5 * 0.5,
}

// 经纬度默认设置为 成都 南湖梦幻岛, 以度数为单位
const DefaultLngLat = {
  lng: 104.0514146,
  lat: 30.5014491,
};

const MERCATOR_A = 6378137.0;
const WORLD_SIZE = MERCATOR_A * Math.PI * 2;

const ThreeboxConstants = {
  WORLD_SIZE: WORLD_SIZE,
  PROJECTION_WORLD_SIZE: WORLD_SIZE / (MERCATOR_A * Math.PI * 2),
  MERCATOR_A: MERCATOR_A,
  DEG2RAD: Math.PI / 180,
  RAD2DEG: 180 / Math.PI,
  EARTH_CIRCUMFERENCE: 40075000, // In meters
}

const r2d = 180 / Math.PI;
const d2r = Math.PI / 180;

// https://developer.mozilla.org/zh-CN/docs/Web/API/MouseEvent/button
const MouseButton = {
  left: 0, // 通常指鼠标左键或默认值
  middle: 1, // 辅助按键，通常指鼠标滚轮中键
  right: 2, //次按键，通常指鼠标右键
}

const ModelResources = [
  {
    url: '/tongyu/model.glb',
    name: 'shan',
    pic: '/tongyu/image/DX.png',
  },
  {
    url: '/tongyu/fireFeiJi.glb',
    name: 'feiJi',
    pic: '/tongyu/image/DX.png',
  },
  {
    url: '/tongyu/TK.glb',
    name: 'TK',
    pic: '/tongyu/image/TK.png',
  },
  {
    url: '/tongyu/TK2.glb',
    name: 'TK',
    pic: '/tongyu/image/TK.png',
  },
  {
    url: '/tongyu/GBW.glb',
    name: 'GBW',
    pic: '/tongyu/image/Shu.png',
  },
  {
    url: '/tongyu/shibei.glb',
    name: 'shibei',
    pic: '/tongyu/image/Shu.png',
  },
  {
    url: '/tongyu/weilan.glb',
    name: 'weilan',
    pic: '/tongyu/image/Shu.png',
  },
  {
    url: '/3d/vegetation/Shu.glb',
    name: 'Shu',
    pic: '/3d/thumbnail/11_14/Shu.png',
  }, {
    url: '/3d/vegetation/Shu2.glb',
    name: 'Shu2',
    pic: '/3d/thumbnail/11_14/Shu2.png',
  }, {
    url: '/3d/vegetation/Shu3.glb',
    name: 'Shu3',
    pic: '/3d/thumbnail/11_14/Shu3.png',
  }, {
    url: '/3d/vegetation/Shu4.glb',
    name: 'Shu4',
    pic: '/3d/thumbnail/11_14/Shu4.png',
  }, {
    url: '/3d/vegetation/Shu5.glb',
    name: 'Shu5',
    pic: '/3d/thumbnail/11_14/Shu5.png',
  }, {
    url: '/3d/vegetation/Shu6.glb',
    name: 'Shu6',
    pic: '/3d/thumbnail/11_14/Shu6.png',
  }, {
    url: '/3d/vegetation/Shu7.glb',
    name: 'Shu7',
    pic: '/3d/thumbnail/11_14/Shu7.png',
  }, {
    url: '/3d/ParkBuilding/dx1008/DiXing.glb',
    name: '园区地形',
    pic: '/3d/thumbnail/11_14/DiXing.png',
  }, {
    url: '/3d/ParkBuilding/dx1008/DX.glb',
    name: '高新区地形',
    pic: '/3d/thumbnail/11_14/DiXing.png',
  }, {
    url: '/3d/ParkBuilding/BanGongLou1.glb',
    name: 'BanGongLou1',
    pic: '/3d/thumbnail/11_14/BanGongLou1.png',
  }, {
    url: '/3d/ParkBuilding/BanGongLou2.glb',
    name: 'BanGongLou2',
    pic: '/3d/thumbnail/11_14/BanGongLou2.png',
  }, {
    url: '/3d/ParkBuilding/BanGongLou3.glb',
    name: 'BanGongLou3',
    pic: '/3d/thumbnail/11_14/BanGongLou3.png',
  }, {
    url: '/3d/ParkBuilding/BanGongLou4.glb',
    name: 'BanGongLou4',
    pic: '/3d/thumbnail/11_14/BanGongLou4.png',
  },{
    url: '/3d/ParkBuilding/BanGongShi.glb',
    name: 'BanGongShi',
    pic: '/3d/thumbnail/11_14/BanGongShi.png',
  }, {
    url: '/3d/ParkBuilding/DaMen.glb',
    name: 'DaMen',
    pic: '/3d/thumbnail/11_14/DaMen.png',
  }, {
    url: '/3d/ParkBuilding/HQZX.glb',
    name: 'HQZX',
    pic: '/3d/thumbnail/11_14/Hqzx.png',
  }, {
    url: '/3d/ParkBuilding/TiKuai.glb',
    name: 'TiKuai',
    pic: '/3d/thumbnail/11_14/TiKuai.png',
  }, {
    url: '/3d/ParkBuilding/F2_detail.glb',
    name: 'F2_detail',
    pic: '/3d/thumbnail/11_14/TiKuai.png',
  }, {
    url: '/3d/ParkBuilding/GateID.glb',
    name: 'GateID',
    pic: '/3d/thumbnail/11_14/GateID.jpg',
  }, {
    url: '/3d/ParkBuilding/JianKong.glb',
    name: 'GateID',
    pic: '/3d/thumbnail/12_25/JianKong.png',
  }, {
    url: '/3d/TiKuai/A2.glb',
    name: 'A2',
    pic: '/3d/thumbnail/12_25/A2.png',
  }, {
    url: '/3d/TiKuai/A3.glb',
    name: 'A3',
    pic: '/3d/thumbnail/12_25/A3.png',
  }, {
    url: '/3d/TiKuai/A4.glb',
    name: 'A4',
    pic: '/3d/thumbnail/12_25/A4.png',
  }, {
    url: '/3d/TiKuai/A5.glb',
    name: 'A5',
    pic: '/3d/thumbnail/12_25/A5.png',
  }, {
    url: '/3d/TiKuai/B1.glb',
    name: 'B1',
    pic: '/3d/thumbnail/12_25/B1.png',
  }, {
    url: '/3d/TiKuai/B2.glb',
    name: 'B2',
    pic: '/3d/thumbnail/12_25/B2.png',
  }, {
    url: '/3d/TiKuai/B3.glb',
    name: 'B3',
    pic: '/3d/thumbnail/12_25/B3.png',
  }, {
    url: '/3d/TiKuai/B4.glb',
    name: 'B4',
    pic: '/3d/thumbnail/12_25/B4.png',
  }, {
    url: '/3d/TiKuai/B5.glb',
    name: 'B5',
    pic: '/3d/thumbnail/12_25/B5.png',
  }, {
    url: '/3d/TiKuai/C1.glb',
    name: 'C1',
    pic: '/3d/thumbnail/12_25/C1.png',
  }, {
    url: '/3d/TiKuai/C2.glb',
    name: 'C2',
    pic: '/3d/thumbnail/12_25/C2.png',
  }, {
    url: '/3d/TiKuai/C3.glb',
    name: 'C3',
    pic: '/3d/thumbnail/12_25/C3.png',
  }, {
    url: '/3d/TiKuai/C4.glb',
    name: 'C4',
    pic: '/3d/thumbnail/12_25/C4.png',
  }, {
    url: '/3d/TiKuai/C5.glb',
    name: 'C5',
    pic: '/3d/thumbnail/12_25/C5.png',
  }, {
    url: '/3d/TiKuai/D1.glb',
    name: 'D1',
    pic: '/3d/thumbnail/12_25/D1.png',
  }, {
    url: '/3d/TiKuai/D2.glb',
    name: 'D2',
    pic: '/3d/thumbnail/12_25/D2.png',
  }, {
    url: '/3d/TiKuai/D3.glb',
    name: 'D3',
    pic: '/3d/thumbnail/12_25/D3.png',
  }, {
    url: '/3d/TiKuai/D4.glb',
    name: 'D4',
    pic: '/3d/thumbnail/12_25/D4.png',
  }, {
    url: '/3d/TiKuai/D5.glb',
    name: 'D5',
    pic: '/3d/thumbnail/12_25/D5.png',
  }, {
    url: '/3d/TiKuai/TK1.glb',
    name: 'TK0',
    pic: '/3d/thumbnail/12_25/TK2.png',
  }, {
    url: '/3d/baked_shadow/shadow1.png',
    name: 'shadow1',
    pic: '/3d/baked_shadow/shadow1.png',
  }
]

const SpriteResources = [
  {
    url: '/tongyu/image/Camera.png',
    name: 'xiangji',
    pic: '/tongyu/image/Camera.png',
  },
  {
    url: '/tongyu/image/Camera2.png',
    name: 'xiangji2',
    pic: '/tongyu/image/Camera2.png',
  },
  {
    url: '/tongyu/image/shuiku.png',
    name: 'shuiku',
    pic: '/tongyu/image/shuiku.png',
  },
  {
    url: '/tongyu/image/shuichi.png',
    name: 'shuichi',
    pic: '/tongyu/image/shuichi.png',
  },
  {
    url: '/tongyu/image/wuzi2.png',
    name: 'wuzi',
    pic: '/tongyu/image/wuzi2.png',
  },
  {
    url: '/tongyu/image/kfsc.png',
    name: 'wuzi',
    pic: '/tongyu/image/kfsc.png',
  },
  {
    url: '/tongyu/image/lwt.png',
    name: 'wuzi',
    pic: '/tongyu/image/lwt.png',
  },
  {
    url: '/tongyu/image/fbsc.png',
    name: 'wuzi',
    pic: '/tongyu/image/fbsc.png',
  },
  {
    url: '/tongyu/image/jcj.png',
    name: 'wuzi',
    pic: '/tongyu/image/jcj.png',
  },
  {
    url: '/tongyu/image/xfz.png',
    name: 'wuzi',
    pic: '/tongyu/image/xfz.png',
  },
]

const usingBaseUrl = ''

const EntityTypes = {
  Model: 'Model',
  LightSource: 'LightSource',
  MonitorCamera: 'MonitorCamera',
  SimpleMark: 'SimpleMark',
  Fence: 'Fence',
  FlyLine: 'FlyLine',
  LightStrip: 'LightStrip',
  PathEdge: 'PathEdge',
  PathPoint: 'PathPoint',
  Group: 'Group',
  Fires: 'Fires',
  Sprite:'Sprite'
}

export {KeyCode, DefaultLngLat, ModelResources, usingBaseUrl, SceneConfig, r2d, d2r, ThreeboxConstants, MouseButton, EntityTypes,SpriteResources}
